package com.sanjiahantang.youjiarole.module.me.quotation.beans;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.sanjiahantang.youjiarole.base.BaseBean;

import org.json.JSONException;
import org.json.JSONObject;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by zy on 2017/10/31.
 */

public class QuotationResponseBean extends BaseBean {
    private String data;
    private int pspId;

    public int getPspId() {
        return pspId;
    }

    public void setPspId(int pspId) {
        this.pspId = pspId;
    }

    public Data getData() {
        return new Gson().fromJson(data,Data.class);
    }

    public void setData(String data) {
        this.data = data;
    }

    public Plan getPlan(){
        return Plan.objectFromData(data);
    }

    public static class Data{

        private int mgpiraId;
        private String resultPrice;
        private String createTime;
        private int skuPrice;
        private int mgsiId;
        private int mgiId;
        private String skuId;
        private int stockCount;
        private int pspId;

        public int getPspId() {
            return pspId;
        }

        public void setPspId(int pspId) {
            this.pspId = pspId;
        }

        public int getMgpiraId() {
            return mgpiraId;
        }

        public void setMgpiraId(int mgpiraId) {
            this.mgpiraId = mgpiraId;
        }

        public String getResultPrice() {
            return resultPrice;
        }

        public void setResultPrice(String resultPrice) {
            this.resultPrice = resultPrice;
        }

        public String getCreateTime() {
            return createTime;
        }

        public void setCreateTime(String createTime) {
            this.createTime = createTime;
        }

        public int getSkuPrice() {
            return skuPrice;
        }

        public void setSkuPrice(int skuPrice) {
            this.skuPrice = skuPrice;
        }

        public int getMgsiId() {
            return mgsiId;
        }

        public void setMgsiId(int mgsiId) {
            this.mgsiId = mgsiId;
        }

        public int getMgiId() {
            return mgiId;
        }

        public void setMgiId(int mgiId) {
            this.mgiId = mgiId;
        }

        public String getSkuId() {
            return skuId;
        }

        public void setSkuId(String skuId) {
            this.skuId = skuId;
        }

        public int getStockCount() {
            return stockCount;
        }

        public void setStockCount(int stockCount) {
            this.stockCount = stockCount;
        }
    }

    public static class Plan{

        private int serviceNum;
        private int serviceType;
        private int isRecommend;
        private String skuFaId;
        private int orderStateId;
        private int pspId;
        private int isPlaceAnOrder;
        private int pushStateId;
        private String serviceName;
        private int userRequireId;
        private String designName;
        private String serviceCount;
        private String phone;
        private String servicePrice;
        private String rolePhone;
        private String typeId;

        public static Plan objectFromData(String str) {

            return new Gson().fromJson(str, Plan.class);
        }

        public static Plan objectFromData(String str, String key) {

            try {
                JSONObject jsonObject = new JSONObject(str);

                return new Gson().fromJson(jsonObject.getString(str), Plan.class);
            } catch (JSONException e) {
                e.printStackTrace();
            }

            return null;
        }

        public static List<Plan> arrayPlanFromData(String str) {

            Type listType = new TypeToken<ArrayList<Plan>>() {
            }.getType();

            return new Gson().fromJson(str, listType);
        }

        public static List<Plan> arrayPlanFromData(String str, String key) {

            try {
                JSONObject jsonObject = new JSONObject(str);
                Type listType = new TypeToken<ArrayList<Plan>>() {
                }.getType();

                return new Gson().fromJson(jsonObject.getString(str), listType);

            } catch (JSONException e) {
                e.printStackTrace();
            }

            return new ArrayList();


        }

        public int getServiceNum() {
            return serviceNum;
        }

        public void setServiceNum(int serviceNum) {
            this.serviceNum = serviceNum;
        }

        public int getServiceType() {
            return serviceType;
        }

        public void setServiceType(int serviceType) {
            this.serviceType = serviceType;
        }

        public int getIsRecommend() {
            return isRecommend;
        }

        public void setIsRecommend(int isRecommend) {
            this.isRecommend = isRecommend;
        }

        public String getSkuFaId() {
            return skuFaId;
        }

        public void setSkuFaId(String skuFaId) {
            this.skuFaId = skuFaId;
        }

        public int getOrderStateId() {
            return orderStateId;
        }

        public void setOrderStateId(int orderStateId) {
            this.orderStateId = orderStateId;
        }

        public int getPspId() {
            return pspId;
        }

        public void setPspId(int pspId) {
            this.pspId = pspId;
        }

        public int getIsPlaceAnOrder() {
            return isPlaceAnOrder;
        }

        public void setIsPlaceAnOrder(int isPlaceAnOrder) {
            this.isPlaceAnOrder = isPlaceAnOrder;
        }

        public int getPushStateId() {
            return pushStateId;
        }

        public void setPushStateId(int pushStateId) {
            this.pushStateId = pushStateId;
        }

        public String getServiceName() {
            return serviceName;
        }

        public void setServiceName(String serviceName) {
            this.serviceName = serviceName;
        }

        public int getUserRequireId() {
            return userRequireId;
        }

        public void setUserRequireId(int userRequireId) {
            this.userRequireId = userRequireId;
        }

        public String getDesignName() {
            return designName;
        }

        public void setDesignName(String designName) {
            this.designName = designName;
        }

        public String getServiceCount() {
            return serviceCount;
        }

        public void setServiceCount(String serviceCount) {
            this.serviceCount = serviceCount;
        }

        public String getPhone() {
            return phone;
        }

        public void setPhone(String phone) {
            this.phone = phone;
        }

        public String getServicePrice() {
            return servicePrice;
        }

        public void setServicePrice(String servicePrice) {
            this.servicePrice = servicePrice;
        }

        public String getRolePhone() {
            return rolePhone;
        }

        public void setRolePhone(String rolePhone) {
            this.rolePhone = rolePhone;
        }

        public String getTypeId() {
            return typeId;
        }

        public void setTypeId(String typeId) {
            this.typeId = typeId;
        }
    }
}
